package com.billiard;

import java.awt.BorderLayout;
import java.awt.Button;
import java.awt.Container;

import javax.swing.JFrame;
import javax.swing.SwingUtilities;

public class Game {
	
	public Game() {
		JFrame frame = new JFrame("Testing new UI component");
		Container contentPane = frame.getContentPane();
		contentPane.setLayout(new BorderLayout());

		GameTable gt = new GameTable();
		
		contentPane.add(gt, BorderLayout.PAGE_START);
		contentPane.add(new Button("Button for clicking"), BorderLayout.PAGE_END);
		
		frame.pack();
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.addComponentListener(new BilliardWindowListener(gt));

		frame.setVisible(true);

		
		Thread thread = new Thread(gt);
		thread.start();
	}
	
	public static void main(String[] args) {

		SwingUtilities.invokeLater(new Runnable() {
			
			@Override
			public void run() {
				new Game();
			}
		});
		
	}
	
	
}
